package o;

import android.app.Activity;
import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.os.Bundle;

public class fhk {
    private final Activity ˎ;
    private Context ˏ;
    private boolean ॱ = false;

    public static fhk ॱ(Activity activity) {
        if (activity instanceof fhl) {
            return new fhk(activity);
        }
        throw new IllegalArgumentException(activity.getClass().getName() + " must implements interface ExposedUIModule.");
    }

    protected boolean ˏ() {
        if (!(this.ॱ || this.ˎ.getIntent() == null)) {
            ˎ(null);
        }
        return this.ˏ != null;
    }

    protected fhk(Activity activity) {
        this.ˎ = activity;
    }

    public void ˎ(Bundle bundle) {
        fhn from = fhn.from(this.ˎ.getIntent());
        if (!(from == null || from.isExternalModule())) {
            this.ˏ = from.getTargetContext();
        }
        this.ॱ = true;
    }

    public Resources ˎ(Resources resources) {
        return ˏ() ? this.ˏ.getResources() : resources;
    }

    public AssetManager ˏ(AssetManager assetManager) {
        return ˏ() ? this.ˏ.getAssets() : assetManager;
    }

    public Theme ˋ(Theme theme) {
        return ˏ() ? this.ˏ.getTheme() : theme;
    }

    public Context ॱ(Context context) {
        return ˏ() ? this.ˏ : context;
    }
}
